package neuralModel.neuron;

public class Signal implements ISignal
{
	private INeuron sourceNeuron;
	private INeuron targetNeuron;
	private double weight;
	private double signalValue;

	public Signal(INeuron sourceNeuron, INeuron targetNeuron, double weight)
	{
		this.sourceNeuron = sourceNeuron;
		this.targetNeuron = targetNeuron;
		this.weight = weight;
		signalValue = 0;
	}

	@Override
	public INeuron getSourceNeuron()
	{
		return sourceNeuron;
	}

	@Override
	public INeuron getTargetNeuron()
	{
		return targetNeuron;
	}

	@Override
	public double getWeight()
	{
		return weight;
	}

	@Override
	public void setWeight(double weight)
	{
		this.weight = weight;
	}

	@Override
	public double getSignalValue()
	{
		return signalValue;
	}

	@Override
	public void setSignalValue(double signalValue)
	{
		this.signalValue = signalValue;
	}

	@Override
	public double getWeightedValue()
	{
		return  Math.pow((signalValue  - weight), 2);
	}

}
